home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cocktail
/
common.lha
/
common
/
c
/
Timer.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-18
|
403b
|
35 lines
/* Timer.c */
/* Bertram Vielsack, 07.03.88 */
#include "Timer.h"
long PrevTime = 0;
long CpuTime ()
{
tms b;
times (&b);
return (b.uTime + b.sTime) * 20;
}
long StepTime ()
{
long ActTime;
long DeltaTime;
ActTime = CpuTime ();
DeltaTime = ActTime - PrevTime;
PrevTime = ActTime;
return DeltaTime;
}
void WriteStepTime (Text)
char Text[];
{
printf ("%s%d\n",Text,StepTime());
}